package com.wunong.smart.commission.starter;

import com.wunong.smart.commission.domain.repository.CommissionRepository;
import com.wunong.smart.commission.starter.repository.CommissionRepositoryImpl;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author create by zealot.zt
 */
@Configuration
@MapperScan(basePackages = CommissionStarterConfiguration.DAO_PACKAGE)
@ComponentScan(CommissionStarterConfiguration.PACKAGE)
public class CommissionStarterConfiguration {

    public static final String PACKAGE = "com.wunong.smart.commission";

    public static final String DAO_PACKAGE = "com.wunong.smart.commission.starter.infrastructure.mapper";

    public static final String PO_PACKAGE = "com.wunong.smart.commission.starter.infrastructure.po";

    @ConditionalOnMissingBean(CommissionRepository.class)
    @Bean
    public CommissionRepository commissionRepository() {
        return new CommissionRepositoryImpl();
    }

}
